﻿namespace Web7.Mvc.ViewModels
{
    public class Web7ViewModelItem<T> : Web7ViewModel
    {

        #region Constructors

        public Web7ViewModelItem()
        {
            this.Item = default(T);
        }
        /// <summary>
        /// Initializes a new instance of the Web7ViewModelItem class.
        /// </summary>
        /// <param name="item">Object that the class is holding.</param>
        public Web7ViewModelItem(T item)
        {
            this.Item = item;
        }

        /// <summary>
        /// Initializes a new instance of the Web7ViewModelItem class.
        /// </summary>
        /// <param name="viewModel">Web7ViewModel instance that the new Web7ViewModelItem class
        /// should take its property settings from.</param>
        /// <param name="item">Object that the class is holding.</param>
        public Web7ViewModelItem(Web7ViewModel viewModel, T item)
            : this(item)
        {
            this.SyncViewModel(viewModel);
        }

        #endregion

        /// <summary>
        /// Object that the class is holding.
        /// </summary>
        public T Item { get; set; }
    }
}
